<?php
$rutaArchivo = "files" . "/" . $codigo;
?>
<h1>Resoluciones proyecto: <?php echo $codigo . "" ?></h1>
<div>
    <table id="tabla"  >
        <thead>
            <tr>
                <th style="width: 5%">ID</th>
                <th style="width: 15%">Fecha</th>
                <th style="width: 10%" >Número</th>
                <th colspan="3"></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($Resolutions as $Resolution): ?>
                <?php
                $rutaDocumento = APP . "webroot" . "/" . "files" . "/" . $codigo . "/" . 'SoporteResolucion-' . $codigo . '-' . $Resolution['Resolution']['id'];
                ?>
                <tr>
                    <td><?php echo $Resolution['Resolution']['id']; ?></td>
                    <td><?php echo $Resolution['Resolution']['fecha']; ?></td>
                    <td><?php echo $Resolution['Resolution']['numero']; ?></td>
                    <td>
                        <table  cellpadding="5px" cellspacing="5px">
                            <tr>
                                <td>
                                    <?php echo $this->Ajax->link('Editar', array('controller' => 'Resolutions', 'action' => 'edit', $Resolution['Resolution']['id']), array('update' => 'content', 'indicator' => 'loading', 'class' => 'actions')); ?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <?php echo $this->Html->link('Imprimir', array('controller' => 'Resolutions', 'action' => 'print_letter', $Resolution['Resolution']['id']), array('target' => 'blank', 'class' => 'actions')); ?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <?php echo $this->Html->link('Carta comunicación', array('controller' => 'Resolutions', 'action' => 'comunication_letter', $Resolution['Resolution']['id']), array('target' => 'blank', 'class' => 'actions')); ?>

                                </td>
                            </tr>
                        </table>
                    </td>

                    <td>

                        <table cellpadding="5px" cellspacing="5px">
                            <tr>
                                <td>
                                    <?php if (file_exists($rutaDocumento . ".pdf")): ?>
                                        <a href="<?php echo $rutaArchivo . "/" . "SoporteResolucion-$codigo-" . $Resolution['Resolution']['id'] . ".pdf" ?>" target="blank" class="actions" >Adjunto</a>
                                    <?php endif; ?>
                                </td>
                            <tr>
                                <td>
                                   
                                    <?php echo $this->Ajax->link('Corrección de información', array('controller' => 'Proyects', 'action' => 'correccion_de_informacion'), array('update' => 'content', 'indicator' => 'loading', 'class' => 'actions')); ?> 

                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <?php echo $this->Ajax->link('Resoluciones modificatorias', array('controller' => 'ResolutionCorrections', 'action' => 'index',$Resolution['Resolution']['id']), array('update' => 'content', 'indicator' => 'loading', 'class' => 'actions')); ?> 

                                </td>
                            </tr>
                        </table>  

                    </td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
</div>  
<br><br><br>
<?php
if (empty($Resolutions))
    echo $ajax->link('Adicionar', array('controller' => 'Resolutions', 'action' => 'add', $proyect_id), array('update' => 'content', 'indicator' => 'loading', 'class' => 'actions'));
?>